﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities
{
    partial class SystemUser : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "UserID":
                   {
                       return typeof(string);
                   }
                case "UserName":
                   {
                       return typeof(string);
                   }
                case "FullName":
                   {
                       return typeof(string);
                   }
                case "Password":
                   {
                       return typeof(string);
                   }
                case "ChangingPassword":
                   {
                       return typeof(bool?);
                   }
                case "UserLocked":
                   {
                       return typeof(bool?);
                   }
                case "LastLogin":
                   {
                       return typeof(DateTime?);
                   }
                case "UserDescription":
                   {
                       return typeof(string);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            SystemUser _instance = instance as SystemUser;
            switch (name)
            {                
                case "UserID":
                   {
                       return _instance.UserID;
                   }
                case "UserName":
                   {
                       return _instance.UserName;
                   }
                case "FullName":
                   {
                       return _instance.FullName;
                   }
                case "Password":
                   {
                       return _instance.Password;
                   }
                case "ChangingPassword":
                   {
                       return _instance.ChangingPassword;
                   }
                case "UserLocked":
                   {
                       return _instance.UserLocked;
                   }
                case "LastLogin":
                   {
                       return _instance.LastLogin;
                   }
                case "UserDescription":
                   {
                       return _instance.UserDescription;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            SystemUser _instance = instance as SystemUser;
            switch (name)
            {                
                case "UserID":
                    {
                        _instance.UserID = (string)value;
                        return;
                    }
                case "UserName":
                    {
                        _instance.UserName = (string)value;
                        return;
                    }
                case "FullName":
                    {
                        _instance.FullName = (string)value;
                        return;
                    }
                case "Password":
                    {
                        _instance.Password = (string)value;
                        return;
                    }
                case "ChangingPassword":
                    {
                        _instance.ChangingPassword = (bool?)value;
                        return;
                    }
                case "UserLocked":
                    {
                        _instance.UserLocked = (bool?)value;
                        return;
                    }
                case "LastLogin":
                    {
                        _instance.LastLogin = (DateTime?)value;
                        return;
                    }
                case "UserDescription":
                    {
                        _instance.UserDescription = (string)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new SystemUser();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<SystemUser>();
        }

        #endregion
    }
}
